﻿namespace OboutInc.Flyout2
{
    using System;
    using System.IO;
    using System.Web.UI;
    using System.Web.UI.Design;

    internal class FlyoutDesigner : ControlDesigner
    {
        public override string GetDesignTimeHtml()
        {
            StringWriter writer = new StringWriter();
            HtmlTextWriter writer2 = new HtmlTextWriter(writer);
            Flyout component = (Flyout) base.Component;
            writer.Write("<table>");
            writer.Write("<tr>");
            writer.Write("<td align='left' style='font-family:Tahoma;font-size:8pt;background-color:silver;height:21px;'>");
            writer.Write("&nbsp;[{0}]", component.ID);
            writer.Write("</td>");
            writer.Write("</tr>");
            writer.Write("<tr>");
            writer.Write("<td align='center'>");
            for (int i = 0; i < component.Controls.Count; i++)
            {
                try
                {
                    component.Controls[i].RenderControl(writer2);
                }
                catch
                {
                }
            }
            writer.Write("</td>");
            writer.Write("</tr>");
            writer.Write("</table>");
            return writer.ToString();
        }

        public override bool AllowResize
        {
            get
            {
                return false;
            }
        }
    }
}

